﻿using System.Collections;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using UnityEngine;
using UnityEngine.Events;

namespace ZGameFramework.UI
{
    public class UIBehaivour : MonoBehaviour, IUIBehaivour
    {
        private void Awake()
        {
            Init();
        }


        /// <summary>
        /// 初始化
        /// </summary>
        public virtual void Init()
        { }

        /// <summary>
        /// 注册事件
        /// </summary>
        public virtual void RegisterEvent()
        { }

        /// <summary>
        /// 注销事件
        /// </summary>
        public virtual void UnRegisterEvent()
        { }    

        /// <summary>
        /// 出场
        /// </summary>
        /// <returns></returns>
        public virtual float FadeIn(GameFrameworkParam param) { return 0; }

        /// <summary>
        /// 入场
        /// </summary>
        /// <returns></returns>
        public virtual float FadeOut() { return 0; }

        /// <summary>
        /// 入场之后
        /// </summary>
        public virtual void FadeInAfter() { }

        /// <summary>
        /// 出场结束
        /// </summary>
        public virtual void FadeOutAfter() {}

        public GameObject m_GameObject { get => this.gameObject; }
    }
}
